package cn.fl.product.controller;

import cmm.comm.facade.framework.api.ISysDictionaryApiService;
import cmm.comm.facade.upload.condition.SysUlFilesRecQueryCondition;
import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.mid.core.framework.page.Pager;
import cmm.user.facade.system.api.ISysOrgApiService;
import cmm.user.facade.system.dto.SysOrgDTO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.logger.eum.LogExceptionEnum;
import cn.cmm.base.framework.logger.eum.LogOperEnum;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.DateUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.framework.constant.DictionaryConstant;
import cn.fl.mfr.web.vo.MfrRlPsnVO;
import cn.fl.product.service.IMfrInfoService;
import cn.fl.product.transform.MfrInfoVOTransform;
import cn.fl.product.vo.MfrInfoVO;
import cn.fl.project.condition.PrjBscInfoQueryCondition;
import cn.fl.project.condition.PrjPrdBscInfoQueryCondition;
import cn.fl.project.service.IPrjBscInfoService;
import cn.fl.project.service.IPrjPrdBscInfoService;
import cn.fl.project.vo.PrjBscInfoVO;
import cn.fl.project.vo.PrjPrdBscInfoVO;
import cn.fl.spl.service.ISplOpLogRecService;
import cn.fl.system.constant.SysLogConstant;
import cn.fl.system.service.ISysUlFilesRecService;
import cn.fl.system.vo.SysUlFilesRecVO;
import cn.fl.upload.constant.UploadConstant;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import fl.constant.facade.framework.constant.BusinessIdConstant;
import fl.flow.facade.flow.api.IFlowApiService;
import fl.flow.facade.flow.condition.SysFlowSHQueryCondition;
import fl.flow.facade.flow.constant.FlowConstant;
import fl.flow.facade.flow.dto.FlowStartParamsDTO;
import fl.flow.facade.flow.dto.SysFlowSHDTO;
import fl.spl.facade.framework.constant.SplSystemConstant;
import fl.spl.facade.framework.enums.SplRelLogBizTypCdNum;
import fl.spl.facade.framework.enums.SplRelLogOpTypCdNum;
import fl.spl.facade.mfr.condition.MfrInfoQueryCondition;
import fl.spl.facade.mfr.constant.MfrInfoConstant;
import fl.spl.facade.mfr.dto.MfrInfoDTO;
import fl.spl.facade.mfr.dto.MfrInfoModDTO;
import fl.spl.facade.spl.constant.SplInfoConstant;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;

/**
 * @Description: 厂商信息表 控制层
 */
@Controller
@RequestMapping("/product/mfrInfo")
public class MfrInfoController extends BaseController {

	/**
	 * PrdMfrInfo 服务层BEAN
	 */
	@Autowired
	private IMfrInfoService prdMfrInfoService;

	/**
	 * 项目产品基础信息表
	 */
	@Autowired
	private IPrjPrdBscInfoService prjPrdBscInfoService;

	/**
	 * 项目基础信息服务
	 */
	@Autowired
	private IPrjBscInfoService prjBscInfoService;

    @Autowired
    private ISysUlFilesRecService sysUlFilesRecService;

	/**
	 * 操作历史记录
	 */
	@Autowired
	private ISplOpLogRecService splOpLogRecService ;
	/**
	 * 操作历史记录
	 */
	@Autowired
	private ISysDictionaryApiService sysDictionaryApiService ;

	@Autowired
	private IFlowApiService flowApiService ;

	@Autowired
	private ISysOrgApiService sysOrgApiService;

	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toListPage.do", method = {RequestMethod.GET})
	public ModelAndView toListPage(HttpServletRequest request, HttpServletResponse response) {

		ModelAndView view = new ModelAndView("product/mfrInfo/prdMfrInfoList");
		BaseLogUtils.newWebLogger("加载厂商列表页面").setLogOperType(LogOperEnum.REQ)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.info();
		return view;
	}

	/**
	 * 到详情列表页面
	 */
	@RequestMapping(value = "/toDetailListPage.do", method = {RequestMethod.GET})
	public ModelAndView toDetailListPage(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.newWebLogger("加载厂商详情列表页面").setLogOperType(LogOperEnum.REQ)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.info();
		ModelAndView view = new ModelAndView("product/mfrInfo/prdMfrInfoDetailList");

		return view;
	}

	/**
	 * 到新增/修改页面
	 */
	@RequestMapping(value = "/toAddPage.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toAddPage(HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		BaseLogUtils.newWebLogger("加载厂商基本信息新增页面").setLogOperType(LogOperEnum.REQ)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.info();
		ModelAndView view = new ModelAndView("product/mfrInfo/prdMfrInfoAdd");
		view.addObject("id", id);
		view.addObject("payTypCdList", JSON.toJSONString(this.prdMfrInfoService.searchCdList("MFR0001")));
		return view;
	}

    /**
     * 到详情页面
     */
    @RequestMapping(value = "/toMfrInfoDetailPage.do", method = {RequestMethod.GET, RequestMethod.POST})
    public ModelAndView toMfrInfoDetailPage(HttpServletRequest request, HttpServletResponse response) {
        String id = request.getParameter("id");
        String modId = request.getParameter("modId");
		BaseLogUtils.newWebLogger("加载厂商基本详情页面").setLogOperType(LogOperEnum.REQ)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.info();
        ModelAndView view = new ModelAndView("mfr/mfrInfoMod/mfrInfoDetail");
        view.addObject("id", id);
        view.addObject("modId", modId);
        return view;
    }
	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initMfrList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String mfrNm = request.getParameter("mfrNm");
		String mfrAddr = request.getParameter("mfrAddr");
		String sortName = request.getParameter("sortname");
		String sortOrder = request.getParameter("sortorder");
		String mfrIdsString = request.getParameter("mfrIdsString");

		String flag = request.getParameter("flag");//被引用为下拉框数据标识

		String condition = request.getParameter("condition");
		String value = "";
		if (StringUtils.isNotBlank(condition)) {
			String con = condition.substring(1, condition.length() - 1);
			if (StringUtils.isNotBlank(con)) {
				net.sf.json.JSONObject fromObject = net.sf.json.JSONObject.fromObject(con);
				value = (String) fromObject.get("value");
			}
		}

		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(currentPage)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		MfrInfoQueryCondition qc = new MfrInfoQueryCondition();
		if (StringUtils.isNotEmpty(mfrNm)) {
			qc.setMfrName(mfrNm);
		}
		if (StringUtils.isNotEmpty(mfrAddr)) {
			qc.setMfrAddr(mfrAddr);
		}
		if (StringUtils.isNotEmpty(sortName) && StringUtils.isNotEmpty(sortOrder)) {
			qc.setSortName(sortName);
			qc.setSortOrder(sortOrder);
		}
		if (StringUtils.isNotEmpty(flag)) {
			if (StringUtils.isEmpty(value) && StringUtils.isEmpty(mfrIdsString)) {//被引用为下拉框却没有查询条件返回null
				return null;
			}
			page.setEveryPage(Integer.MAX_VALUE);//最大数据量
			qc.setIsValid(BaseConstant.IS_YESNO_YES);//启用
			qc.setAudStsCd(FlowConstant.FLOW_CHECK_STATE_PASS);//审核通过
		}
		if (StringUtils.isNotEmpty(value)) {
			qc.setMfrName(value.trim());
		} else if (StringUtils.isNotEmpty(mfrIdsString)) {
			String[] strings = mfrIdsString.trim().split(";");
			List<Long> splIds = new ArrayList<Long>();
			for (String string : strings) {
				splIds.add(Long.valueOf(string));
			}
			qc.setIdList(splIds);
		}
		page.setCondition(qc);

		Pager pager = this.prdMfrInfoService.searchListPage(page);
		List<MfrInfoDTO> list = (List<MfrInfoDTO>) pager.getResultList();
		ListPageVO<MfrInfoDTO> listPage = new ListPageVO<MfrInfoDTO>(list, pager.getTotalCount());
		BaseLogUtils.newWebLogger("初始化厂商列表页面数据").setLogOperType(LogOperEnum.RESP)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.setKeys("listPage", JSON.toJSONString(listPage))
				.info();
		return listPage;
	}

	@RequestMapping("searchList.do")
	@ResponseBody
	public List<MfrInfoVO> searchList(String name) {

		MfrInfoQueryCondition qc = new MfrInfoQueryCondition();
		if (StringUtils.isNotBlank(name)) {
			qc.setMfrName(name);
		}
		List<MfrInfoVO> mfrInfoVOS = prdMfrInfoService.searchList(qc);
		return mfrInfoVOS;
	}

	/**
	 * 删除数据
	 */
	@RequestMapping(value = "/removeByIds.do", method = {RequestMethod.POST})
	@ResponseBody
	public DataResultVO removeMfrById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String ids = request.getParameter("ids");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
		if (StringUtils.isEmpty(ids)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("删除厂商失败,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}

		List<Long> idsList = new ArrayList<Long>();
		JSONArray idsArray = JSONArray.fromObject(ids);
		for (Object object : idsArray) {
			idsList.add(Long.valueOf(object.toString()));
		}

		try {
			boolean success = this.prdMfrInfoService.removeByIds(idsList);
			if (!success) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_DELETE_FAIL);
				BaseLogUtils.newWebLogger("删除厂商失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			BaseLogUtils.newWebLogger("删除厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("删除厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("删除厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}

		return result;
	}

	/**
	 * 得到一条记录
	 *
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getById.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object getMfrById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("获取厂商数据,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}

		try {
			MfrInfoVO vo = this.prdMfrInfoService.selectById(Long.valueOf(id), CurrentThreadContext.getCurrentOrgCd());
			if (null == vo) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.newWebLogger("获取厂商数据不存在").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			result.setData(vo);
			BaseLogUtils.newWebLogger("获取厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("result", JSON.toJSONString(result))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("获取厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("获取厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 新增
	 */
	@RequestMapping(value = "/add.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object addMfr(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		MfrInfoVO entity = new MfrInfoVO();
		try {
			entity = this.getRequestParamForPrdMfrAdd(request);//获取参数
			Long id = this.prdMfrInfoService.add(entity, CurrentThreadContext.getCurrentOrgCd());
			result.setData(id);
			BaseLogUtils.newWebLogger("新增厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("entity", JSON.toJSONString(entity))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("新增厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("新增厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}

		return result;
	}

	/**
	 * 修改
	 */
	@RequestMapping(value = "/modify.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object modifyMfr(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_UPDATE_SUCC);
		MfrInfoVO entity = new MfrInfoVO();
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("修改厂商信息,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}
		try {
			entity = this.getRequestParamForPrdMfrModify(request);
			entity.setId(Long.valueOf(id));
			boolean success = this.prdMfrInfoService.modify(entity, CurrentThreadContext.getCurrentOrgCd());
			if (!success) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
				BaseLogUtils.newWebLogger("修改厂商数据失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			BaseLogUtils.newWebLogger("修改厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("entity", JSON.toJSONString(entity))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("修改厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("修改厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 启用厂商
	 */
	@RequestMapping(value = "/enable.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object enableMfr(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ENABLE_SUCC);
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("启用厂商失败,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}

		try {

			boolean success = this.prdMfrInfoService.enAblePrdMfrInfo(Long.valueOf(id));
			if (!success) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_ENABLE_FAIL);
				BaseLogUtils.newWebLogger("启用厂商失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			BaseLogUtils.newWebLogger("启用厂商成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("启用厂商失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("启用厂商失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 禁用厂商
	 */
	@RequestMapping(value = "/disable.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object disableMfr(HttpServletRequest request, HttpServletResponse response) throws BaseException {

		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DISABLE_SUCC);
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("禁用厂商失败,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}

		try {

			boolean success = this.prdMfrInfoService.disAblePrdMfrInfo(Long.valueOf(id));
			if (!success) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_DISABLE_FAIL);
				BaseLogUtils.newWebLogger("禁用厂商失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			BaseLogUtils.newWebLogger("禁用厂商成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("禁用厂商失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("禁用厂商失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}


	//********************私有方法********************//

    /**
     * 获取厂商参数信息
     *
     * @param request
     * @return
     * @throws BaseException
     */
    private MfrInfoVO getRequestParamForPrdMfr(HttpServletRequest request) throws BaseException {
        String mfrNm = request.getParameter("mfrNm");//厂商名称
        String succ = request.getParameter("succ");// 社会统一信用代码
        String mfrAddrese = request.getParameter("mfrAddr");// 厂商地址
        String rgnPrCd = request.getParameter("rgnPrCd");
        String rgnCyCd = request.getParameter("rgnCyCd");
        String mfrTel = request.getParameter("mfrTel");//办公电话
        String tkBrCdString = request.getParameter("tkBrCd");
        String carBrCdString = request.getParameter("carBrCd");
        String busBrCdString = request.getParameter("busBrCd");
        String payTypCd = request.getParameter("payTypCd");//放款方式 0.非差额放款 1.差额放款 默认0
        String payTypCdNm = request.getParameter("payTypCdNm");//放款方式 0.非差额放款 1.差额放款 默认0
        String mfrRlPsnListString = request.getParameter("mfrRlPsnList");// 主要人员名称

        List<MfrRlPsnVO> mfrRlPsnList = null;

        //验证必填项及长度
        if (StringUtils.isBlank(mfrNm)) {
            throw new BaseException(BaseExceptionConstant.COMMON_0001, "厂商名称不能为空.");
        }
        if (StringUtils.isEmpty(succ)) {
            throw new BaseException(BaseExceptionConstant.COMMON_0001, "社会统一信用代码不能为空");
        }
        /*if (StringUtils.isBlank(mfrRlPsnListString) || !StringUtils.isCustomerName(lmNm)) {
            throw new BaseException(BaseExceptionConstant.COMMON_0001, "联系人不能为空,支持格式[艾合买提•倪格提]");
        }*/
        if (StringUtils.isNotBlank(mfrTel)) {
            if (!StringUtils.isMobilePhoneAndFixedPhone(mfrTel)) {
                throw new BaseException(BaseExceptionConstant.COMMON_0001, "请输入正确的办公电话.");
            }
        }
        if (StringUtils.isEmpty(mfrRlPsnListString)) {
            throw new BaseException(BaseExceptionConstant.COMMON_0001, "请维护主要人员关系");
        } else {
            mfrRlPsnList = JSONObject.parseArray(mfrRlPsnListString, MfrRlPsnVO.class);

            //证件类型
            Map<String, String> rlTypCdList = this.sysDictionaryApiService.searchGroupToMap(CurrentThreadContext.getCurrentSysCd(),
                    CurrentThreadContext.getCurrentOrgCd(), DictionaryConstant.CODE_RL_TYP_CD);

            boolean isHaveActualPsn1 = false; //法人代表
            boolean isHaveActualPsn3 = false; //联系人
            boolean isHaveActualPsn4 = false;    //实际控制人
            boolean isHaveActualPsn5 = false;    //股东

            //证件类型

            for (MfrRlPsnVO mfrRlPsnVO : mfrRlPsnList) {
                //验证输入项是否为空
                if (StringUtils.isEmpty(mfrRlPsnVO.getRlNm()) || !StringUtils.isCustomerName(mfrRlPsnVO.getRlNm())) {
                    throw new BaseException(BaseExceptionConstant.COMMON_0001, rlTypCdList.get(mfrRlPsnVO.getRlTypCd()) + "姓名为空或格式不正确,支持格式[艾合买提•倪格提]");
                } else if (StringUtils.isEmpty(mfrRlPsnVO.getRlTypCd())) {
                    throw new BaseException(BaseExceptionConstant.COMMON_0001, "联系人类型不能为空.");
                }
                if ("1".equals(mfrRlPsnVO.getIsDefault()) && (SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_1.equals(mfrRlPsnVO.getRlTypCd())
                        || SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_5.equals(mfrRlPsnVO.getRlTypCd())
                        || SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_3.equals(mfrRlPsnVO.getRlTypCd())
                        || SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_4.equals(mfrRlPsnVO.getRlTypCd()))) {

                    //验证输入项是否为空
                    if (StringUtils.isEmpty(mfrRlPsnVO.getTel())) {
                        throw new BaseException(BaseExceptionConstant.COMMON_0001, rlTypCdList.get(mfrRlPsnVO.getRlTypCd()) + "电话不能为空.");
                    } else if (StringUtils.isEmpty(mfrRlPsnVO.getCertTypCd())) {
                        throw new BaseException(BaseExceptionConstant.COMMON_0001, rlTypCdList.get(mfrRlPsnVO.getRlTypCd()) + "证件类型不能为空.");
                    } else if (StringUtils.isEmpty(mfrRlPsnVO.getCertNo())) {
                        throw new BaseException(BaseExceptionConstant.COMMON_0001, rlTypCdList.get(mfrRlPsnVO.getRlTypCd()) + "证件号码不能为空.");
                    }
                }

                if (null != mfrRlPsnVO && SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_1.equals(mfrRlPsnVO.getRlTypCd())) {
                    isHaveActualPsn1 = true;
                } else if (null != mfrRlPsnVO && SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_3.equals(mfrRlPsnVO.getRlTypCd())) {
                    isHaveActualPsn3 = true;
                } else if (null != mfrRlPsnVO && SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_4.equals(mfrRlPsnVO.getRlTypCd())) {
                    isHaveActualPsn4 = true;
                } else if (null != mfrRlPsnVO && SplInfoConstant.SPL_RL_TYP_CD_ACTUAL_5.equals(mfrRlPsnVO.getRlTypCd())) {
                    isHaveActualPsn5 = true;
                }
            }
            if (!isHaveActualPsn1) {
                throw new BaseException(BaseExceptionConstant.COMMON_0001, "请维护法人代表.");
            }
            if (!isHaveActualPsn3) {
                throw new BaseException(BaseExceptionConstant.COMMON_0001, "请维护主要联系人.");
            }
            if (!isHaveActualPsn4) {
                throw new BaseException(BaseExceptionConstant.COMMON_0001, "请维护实际控制人.");
            }
            if (!isHaveActualPsn5) {
                throw new BaseException(BaseExceptionConstant.COMMON_0001, "请维护股东信息.");
            }

            if (CollectionUtils.isNotEmpty(mfrRlPsnList)) {
                for (MfrRlPsnVO mfrRlPsnVO : mfrRlPsnList) {
                    if (StringUtils.isEmpty(mfrRlPsnVO.getIsDel())) {
                        mfrRlPsnVO.setIsDel(BaseConstant.IS_YESNO_NO);
                        mfrRlPsnVO.setIsValid(BaseConstant.IS_YESNO_YES);
                    }
                    if (StringUtils.isEmpty(mfrRlPsnVO.getId())) {
                        mfrRlPsnVO.setIsDel(BaseConstant.IS_YESNO_NO);
                        mfrRlPsnVO.setIsValid(BaseConstant.IS_YESNO_YES);
                        mfrRlPsnVO.setCrtTm(new Date());
                        mfrRlPsnVO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
                    } else {
                        mfrRlPsnVO.setMdfTm(new Date());
                        mfrRlPsnVO.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
                    }
                    mfrRlPsnVO.setBrPerVerify("2");
                    mfrRlPsnVO.setPyPerVerify("2");
                    mfrRlPsnVO.setTdPerVerify("2");
                    mfrRlPsnVO.setBusInfoVerify("2");
                }
            }
			BaseLogUtils.newWebLogger("联系人信息").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("mfrRlPsnList", JSON.toJSONString(mfrRlPsnList))
					.info();
        }

        List<String> tkBrCdList = new ArrayList<String>();
        if (StringUtils.isNotEmpty(tkBrCdString)) {
            String[] tkBrCdStr = tkBrCdString.split(";");
            if (tkBrCdStr.length > 0) {
                for (String string : tkBrCdStr) {
                    tkBrCdList.add(string);
                }
            }
        }

        List<String> carBrCdList = new ArrayList<String>();
        if (StringUtils.isNotEmpty(carBrCdString)) {
            String[] carBrCdStr = carBrCdString.split(";");
            if (carBrCdStr.length > 0) {
                for (String string : carBrCdStr) {
                    carBrCdList.add(string);
                }
            }
        }

        List<String> busBrCdList = new ArrayList<String>();
        if (StringUtils.isNotEmpty(busBrCdString)) {
            String[] busBrCdStr = busBrCdString.split(";");
            if (busBrCdStr.length > 0) {
                for (String string : busBrCdStr) {
                    busBrCdList.add(string);
                }
            }
        }

        MfrInfoVO mfrInfoVO = new MfrInfoVO();

        mfrInfoVO.setMfrName(this.checkMfrNm(mfrNm));
        mfrInfoVO.setSucc(succ);
        if (StringUtils.isNotEmpty(mfrAddrese)) {
            mfrInfoVO.setMfrAddr(mfrAddrese);
        }
        if (StringUtils.isNotEmpty(rgnPrCd)) {
            mfrInfoVO.setRgnPrCd(rgnPrCd);
        }
        if (StringUtils.isNotEmpty(rgnCyCd)) {
            mfrInfoVO.setRgnCyCd(rgnCyCd);
        }
        if (StringUtils.isNotEmpty(mfrTel)) {
            mfrInfoVO.setMfrTel(mfrTel);
        }
        mfrInfoVO.setPayTypCd(payTypCd);
        mfrInfoVO.setPayTypCdNm(payTypCdNm);
        if (CollectionUtils.isNotEmpty(tkBrCdList)) {
            mfrInfoVO.setTkBrCdList(tkBrCdList);
        }
        if (CollectionUtils.isNotEmpty(carBrCdList)) {
            mfrInfoVO.setCarBrCdList(carBrCdList);
        }
        if (CollectionUtils.isNotEmpty(busBrCdList)) {
            mfrInfoVO.setBusBrCdList(busBrCdList);
        }
        if (CollectionUtils.isNotEmpty(mfrRlPsnList)) {
            mfrInfoVO.setMfrRlPsnList(mfrRlPsnList);
        }
        return mfrInfoVO;
    }

    /**
     * 获取厂商请求参数(新增)
     *
     * @param request 请求
     * @return
     */
    private MfrInfoVO getRequestParamForPrdMfrAdd(HttpServletRequest request) throws BaseException {
        MfrInfoVO prdMfrInfoVO = this.getRequestParamForPrdMfr(request);
        prdMfrInfoVO.setMfrSource(SplSystemConstant.FL_WEB_CHL_CD);
        prdMfrInfoVO.setCrtTm(new Date());
        prdMfrInfoVO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
        return prdMfrInfoVO;
    }

    /**
     * 获取厂商请求参数(修改)
     *
     * @param request 请求
     * @return
     */
    private MfrInfoVO getRequestParamForPrdMfrModify(HttpServletRequest request) throws BaseException {
		String id = request.getParameter("id");
		if (StringUtils.isEmpty(id)){
			throw new BaseException(BaseExceptionConstant.COMMON_0001, "修改厂商ID不能为空.");
		}
        MfrInfoVO prdMfrInfoVO = this.getRequestParamForPrdMfr(request);
        prdMfrInfoVO.setId(Long.valueOf(id));
        prdMfrInfoVO.setMdfTm(new Date());
        prdMfrInfoVO.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
        return prdMfrInfoVO;
    }

    /**
     * 特殊字符(除中英文括号外)和空格校验
     *
     * @param mfrNm 厂商名称
     * @return String
     */
    private String checkMfrNm(String mfrNm) throws BaseException {
        String base = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM()（）";
        int len = mfrNm.length();
        StringBuilder sb = new StringBuilder(len);
        for (int i = 0; i < len; i++) {
            char c = mfrNm.charAt(i);
            if (base.contains(c + "") || StringUtils.isNumeric(c + "") || StringUtils.isChinese(c)) {
                sb.append(c);
            }
        }
        return sb.toString();
    }


	/**
	 * 跳转到厂商项目详细页面
	 */
	@RequestMapping(value = "/toMfrPrjBscInfoDetailList.do", method = {RequestMethod.GET})
	public ModelAndView toMfrPrjBscInfoDetailList(HttpServletRequest request, HttpServletResponse response) {
		String mfrId = request.getParameter("mfrId");
		ModelAndView view = new ModelAndView("product/mfrInfo/mfrPrjBscInfoDetailList");
		view.addObject("mfrPrjViewFlag", "mfrPrjViewFlag");
		view.addObject("mfrId", mfrId);
		BaseLogUtils.newWebLogger("跳转到厂商项目详细列表").setLogOperType(LogOperEnum.REQ)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
				.setWarning(false)
				.setKeys("mfrId", JSON.toJSONString(mfrId))
				.info();
		return view;
	}

	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initMfrPrjList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initMfrPrjList(HttpServletRequest request, HttpServletResponse response) {

		String mfrId = request.getParameter("mfrId");

		PrjPrdBscInfoQueryCondition qc = new PrjPrdBscInfoQueryCondition();
		qc.setSplMfrId(Long.parseLong(mfrId));
		// 获取该厂商下的所有项目产品
		List<PrjPrdBscInfoVO> prjPrdBscInfoVOList = prjPrdBscInfoService.searchList(qc);
		if (CollectionUtils.isEmpty(prjPrdBscInfoVOList)) {
			return new ListPageVO<PrjBscInfoVO>();
		}
		List<Long> ids = new ArrayList<>();
		for (PrjPrdBscInfoVO prjPrdBscInfoVO : prjPrdBscInfoVOList) {
			if (!ids.contains(prjPrdBscInfoVO.getPrjId())) {
				ids.add(prjPrdBscInfoVO.getPrjId());
			}
		}

		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		String prjNm = request.getParameter("prjNm");
		String cstNm = request.getParameter("cstNm");
		String prjTyCd = request.getParameter("prjTypCd");
		String bizTypCd = request.getParameter("bizTypCd");
		String prjStsCd = request.getParameter("prjStsCd");
		String buOrgCd = request.getParameter("buOrgCd");// 事业部
		String cstId = request.getParameter("cstId");// 客户ID
		String splId = request.getParameter("splId");// 供应商ID(YAOXIURONG)
		String lsCntNo = request.getParameter("lsCntNo");
		String lnkCompId = request.getParameter("lnkCompId");// 挂靠公司ID
		String cstMgrNm = request.getParameter("cstMgrNm");// 客户经理
		String cntTypCd = request.getParameter("cntTypCd");
		String isDel = request.getParameter("isDel");//是否删除
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");
		String userNm = request.getParameter("userNm");
		String ovdViewFlag = request.getParameter("ovdViewFlag");
		String cstMgrId = request.getParameter("cstMgrId");
		String insCode = request.getParameter("insCode");
		String fundRasInsId = request.getParameter("fundRasInsId");
		String stDt = request.getParameter("stDt");
		String endDt = request.getParameter("endDt");
		Pager page = new Pager();

		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}

		PrjBscInfoQueryCondition prjBscInfoQueryCondition = new PrjBscInfoQueryCondition();
		if (CollectionUtils.isNotEmpty(ids)) {
			prjBscInfoQueryCondition.setIdList(ids);
		}
		if (StringUtils.isNotBlank(stDt)) {
			prjBscInfoQueryCondition.setStDt(DateUtils.formatStringToDate(stDt, DateUtils.YYYY_MM_DD));
		}
		if (StringUtils.isNotBlank(endDt)) {
			prjBscInfoQueryCondition.setEndDt(DateUtils.formatStringToDate(endDt, DateUtils.YYYY_MM_DD));
		}
		if (StringUtils.isNotBlank(fundRasInsId)) {
			prjBscInfoQueryCondition.setFundRasInsId(Long.valueOf(fundRasInsId));
		}
		if (StringUtils.isNotBlank(insCode)) {
			prjBscInfoQueryCondition.setInsCode(insCode);
		}
		if (StringUtils.isNotBlank(cstMgrOrgCd)) {
			prjBscInfoQueryCondition.setCstMgrOrgCd(cstMgrOrgCd);
		}
		if (StringUtils.isNotBlank(buOrgCd)) {
			prjBscInfoQueryCondition.setBuOrgCd(buOrgCd);
		}
		if (StringUtils.isNotBlank(isDel)) {
			prjBscInfoQueryCondition.setIsDel(Integer.valueOf(isDel));
		}
		if (StringUtils.isNotBlank(lsCntNo)) {
			prjBscInfoQueryCondition.setLsCntNo(lsCntNo);
		}
		if (StringUtils.isNotBlank(cntTypCd)) {
			prjBscInfoQueryCondition.setCntTypCd(cntTypCd);
		}
		if (StringUtils.isNotBlank(cstMgrNm)) {
			prjBscInfoQueryCondition.setCstMgrNm(cstMgrNm);
		}
		if (StringUtils.isNotBlank(lnkCompId)) {
			prjBscInfoQueryCondition.setCompLnkId(Long.valueOf(lnkCompId));
		}
		if (StringUtils.isNotBlank(prjNm)) {
			prjBscInfoQueryCondition.setPrjNm(prjNm);
		}
		if (StringUtils.isNotBlank(cstNm)) {
			prjBscInfoQueryCondition.setCstNm(cstNm);
		}
		if (StringUtils.isNotBlank(prjTyCd)) {
			prjBscInfoQueryCondition.setPrjTypCd(prjTyCd);
		}
		if (StringUtils.isNotBlank(bizTypCd)) {
			prjBscInfoQueryCondition.setBizTypCd(bizTypCd);
		}
		if (StringUtils.isNotBlank(prjStsCd)) {
			if (prjStsCd.equals(FlowConstant.FLOW_CHECK_STATE_NON)) {
				prjBscInfoQueryCondition.setDefPrjStsCd(prjStsCd);
			} else {
				prjBscInfoQueryCondition.setPrjStsCd(prjStsCd);
			}
			prjBscInfoQueryCondition.setSysCd(CurrentThreadContext.getCurrentSysCd());
		}
		if (StringUtils.isNotEmpty(cstId) && StringUtils.isNumeric(cstId)) {
			List<Long> cstIdList = new ArrayList<>();
			cstIdList.add(Long.valueOf(cstId));
			prjBscInfoQueryCondition.setCstIdList(cstIdList);
		}
		if (StringUtils.isNotEmpty(splId) && StringUtils.isNumeric(splId)) {
			prjBscInfoQueryCondition.setSplId(Long.valueOf(splId));// YAOXIURONG
		}
		if (StringUtils.isNotEmpty(mfrId) && StringUtils.isNumeric(mfrId)) {
			prjBscInfoQueryCondition.setMfrId(Long.valueOf(mfrId));// tsn
		}
		if (StringUtils.isNotEmpty(userNm)) {
			prjBscInfoQueryCondition.setUserNm(userNm);
		}
		prjBscInfoQueryCondition.setUsrId(CurrentThreadContext.getCurrentUserId());
		prjBscInfoQueryCondition.setSysCd(CurrentThreadContext.getCurrentSysCd());
		if (StringUtils.isNotEmpty(cstMgrId)) {
			prjBscInfoQueryCondition.setCstMgrId(Long.parseLong(cstMgrId));
		}
		page.setCondition(prjBscInfoQueryCondition);
		Pager pager = this.prjBscInfoService.searchListPage(page);
		List<PrjBscInfoVO> list = (List<PrjBscInfoVO>) pager.getResultList();
		if (CollectionUtils.isNotEmpty(list) && "ovdViewFlag".equals(ovdViewFlag)) {
			this.prjBscInfoService.putOvdDataToPrjBscInfo(list);
		}
		ListPageVO<PrjBscInfoVO> listPage = new ListPageVO<PrjBscInfoVO>(list,
				pager.getTotalCount());
		return listPage;
	}

	/**
	 * 发起厂商准入流程
	 */
	@RequestMapping(value = "/addMfrFlowStart.do", method = { RequestMethod.POST})
	@ResponseBody
	public Object addMfrFlowStart(HttpServletRequest request, HttpServletResponse response) {
		String id = request.getParameter("id");
		String procDefKey = request.getParameter("procDefKey");
		String procDefId = request.getParameter("procDefId");
		String procNo = request.getParameter("procNo");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}
		//校验是否已发起流程
		if(this.prdMfrInfoService.checkMfrInfoFlowStatus(Long.valueOf(id))){
			throw new BaseException(BaseExceptionConstant.COMMON_0001, "该厂商存在准入流程，请流程结束后再发起审核流程.");
		}
		//校验是否有变更流程
		if(this.prdMfrInfoService.checkMfrModFlowStatus(Long.valueOf(id))){
			throw new BaseException(BaseExceptionConstant.COMMON_0001, "该厂商存在变更流程，请变更流程结束后再发起审核流程.");
		}
		FlowStartParamsDTO flowStartParamsDTO = new FlowStartParamsDTO();
		try {
			//流程定义Key和流程定义ID 如果是前端选择的则直接指定,如果不是则系统自动按照配置选择唯一一条记录,如果找不到会提示
			flowStartParamsDTO.setAudStsCd(FlowConstant.FLOW_CHECK_STATE_IN);

			flowStartParamsDTO.setWordsInTheTable(MfrInfoConstant.MFR_INFO_FLOW_S_H_MFR);
			//流程定义标识(必填)
			flowStartParamsDTO.setProcDefKey(procDefKey);
			//流程定义ID(必填)
			flowStartParamsDTO.setProcDefId(procDefId);
			//流程定义名称(自定义)
			flowStartParamsDTO.setProcNo(procNo);

			flowStartParamsDTO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
			//业务数据主键(必填)
			flowStartParamsDTO.setBusinessKey(id);
			flowStartParamsDTO.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
			flowStartParamsDTO.setBuOrgCd(CurrentThreadContext.getCurrentBuOrgCd());
			flowStartParamsDTO.setSysCd(CurrentThreadContext.getCurrentSysCd());
			flowStartParamsDTO.setInitiator(String.valueOf(CurrentThreadContext.getCurrentUserId()));
			flowStartParamsDTO.setInitiatorNm(CurrentThreadContext.getCurrentUserName());
			flowStartParamsDTO.setProcPriority(FlowConstant.FLOW_PRIORITY_EMERGENCY);//优先级,可以在界面定义
			//业务类型(必填)-用于区分操作表标识
			flowStartParamsDTO.setBusinessType(MfrInfoConstant.MFR_INFO_FLOW_S_H_MFR_TAB);//确认用不用
			//模块类型(流程业务分类): 针对直接启动流程的业务使用
			flowStartParamsDTO.setModelTyp(MfrInfoConstant.MFR_INFO_FLOW_BUS_TYP_CD);//需要和流程配置中的模块类型匹配
			flowStartParamsDTO.setSearchDesc(CurrentThreadContext.getCurrentOrgDispNm()+"、厂商流程大字段参数未定!");
			DataResultDTO dataResultDTO = this.prdMfrInfoService.addMfrAccessFlowStart(flowStartParamsDTO);
			if(dataResultDTO != null){
				if(dataResultDTO.getCode() != null && !dataResultDTO.getCode().equals(BaseExceptionConstant.BASE_EXCEPTION_CODE_200)){
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo(SysLogConstant.LOG_CMM_OPERATE_FAIL);
				}
			}

			// 发起审核流程成功
			String reason = request.getParameter("reason");// 操作原因
			try {
				if (StringUtils.isNotEmpty(reason)) {
					Long add = this.splOpLogRecService.add(id, reason, SplRelLogOpTypCdNum.STARTFLOW.getOpTypCd(), SplRelLogBizTypCdNum.MFR.getBizTypCd());
				}
			} catch (BaseException e) {
				BaseLogUtils.newWebLogger("插入供应商操作记录失败，业务异常").setLogOperType(LogOperEnum.REQ)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.setThrowable(e)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}
			/*if(null != dataResultDTO.getInfo() && StringUtils.isNotEmpty(dataResultDTO.getInfo())){
				StringBuffer info = new StringBuffer();
				info.append(result.getInfo());
				info.append(SysLogConstant.LOG_FLOW_NEXT_TASK_OPERATOR);
				info.append(dataResultDTO.getInfo());//操作人
				result.setInfo(info.toString());
			}*/
		} catch (BaseException e) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(e.getMessage());
			BaseLogUtils.newWebLogger("插入供应商操作记录失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(e)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			e.getStackTrace();
		} catch (Exception e) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("插入供应商操作记录失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(e)
					.error(LogExceptionEnum.COMMON_CODE_0099);
			e.getStackTrace();
		}
		return result;
	}


	/**
	 * 检查厂商主要流程信息是否变更
	 */
	@RequestMapping(value = "/checkChangeMfrInfo.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object checkChangeMfrInfo(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		String isBsc = request.getParameter("isBsc");//是否 基础信息变更   “1”  基础信息变更    “0”  放款方式变更
		String modId = request.getParameter("modId");
		String fileParams = request.getParameter("fileParams");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_UPDATE_SUCC);
		MfrInfoDTO entity = MfrInfoVOTransform.toDTO(this.getRequestParamForPrdMfrModify(request));
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("修改厂商信息,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}
		if (StringUtils.isEmpty(isBsc)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_PARAM_IS_BAD);
			BaseLogUtils.newWebLogger("修改厂商信息,参数不完整").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}
		try {
			result.setInfo("0");
			//判断是否应该发起变更流程
			if (StringUtils.isEmpty(modId)){
                boolean flag  = false;
                if (StringUtils.isNotEmpty(fileParams)) {
                    JSONArray arry = JSONArray.fromObject(fileParams);
                    if ((arry.size() > 0)) {
                        flag = true;
					}else {
						flag = this.prdMfrInfoService.getChangeStatus(entity,isBsc);
                    }
                }else{
					flag = this.prdMfrInfoService.getChangeStatus(entity,isBsc);
				}
				if (flag) {
					if ("0".equals(isBsc)) {
						//判断是否在登陆人所属事业部 存在放款方式变更流程
						boolean auditStatus = this.prdMfrInfoService.checkMfrPayTypModFlowStatus(Long.valueOf(id), CurrentThreadContext.getCurrentBuOrgCd());
						if (auditStatus) {
							result.setSuccess(BaseConstant.IS_YESNO_NO);
							result.setInfo("该供应商已存在放款方式变更流程，不能重复发起变更！");
							BaseLogUtils.newWebLogger("该供应商已存在放款方式变更流程，不能重复发起变更").setLogOperType(LogOperEnum.RESP)
									.setSysCd(CurrentThreadContext.getCurrentSysCd())
									.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
									.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
									.setWarning(false)
									.warn(LogExceptionEnum.COMMON_CODE_0002);
							return result;
						}
					}else{
						//判断是否存在基础信息变更流程
						boolean auditStatus = this.prdMfrInfoService.checkMfrBaseModFlowStatus(Long.valueOf(id));
						if (auditStatus) {
							result.setSuccess(BaseConstant.IS_YESNO_NO);
							result.setInfo("该供应商已存在基础信息变更申请流程，不能重复发起变更！");
							BaseLogUtils.newWebLogger("该供应商已存在基础信息变更申请流程,不能重复发起变更").setLogOperType(LogOperEnum.RESP)
									.setSysCd(CurrentThreadContext.getCurrentSysCd())
									.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
									.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
									.setWarning(false)
									.warn(LogExceptionEnum.COMMON_CODE_0002);
							return result;
						}
					}
					result.setInfo("1");
				}
			}
			BaseLogUtils.newWebLogger("修改供应商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("entity", JSON.toJSONString(entity))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("修改供应商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("修改供应商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 变更厂商信息
	 */
	@RequestMapping(value = "/modifyMfrInfoStartFlow.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object modifyMfrInfoStartFlow(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES);
		String id = request.getParameter("id");
		String procDefKey = request.getParameter("procDefKey");
		String procDefId = request.getParameter("procDefId");
		String procNo = request.getParameter("procNo");
		String fileParams = request.getParameter("fileParams");
		if (StringUtils.isEmpty(id)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("修改厂商信息,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}
		MfrInfoDTO mfrInfoDTO = MfrInfoVOTransform.toDTO(this.getRequestParamForPrdMfrModify(request));
		mfrInfoDTO.setBuOrgCd(CurrentThreadContext.getCurrentBuOrgCd());
		SysOrgDTO sysOrgDTO = this.sysOrgApiService.selectSysOrgByOrgCd(CurrentThreadContext.getCurrentBuOrgCd(),CurrentThreadContext.getCurrentSysCd());
		if(null != sysOrgDTO){
			mfrInfoDTO.setBuOrgCdNm(sysOrgDTO.getOrgDispNm());
		}
		try {
			if(StringUtils.isNotEmpty(procDefKey)){
				MfrInfoModDTO mfrInfoModDTO = new MfrInfoModDTO();
				mfrInfoModDTO.setIsFileMdf(BaseConstant.IS_YESNO_NO);
				String modelTyp = MfrInfoConstant.MFR_BASE_MOD_FLOW_BUS_TYP_CD;
				//校验是否已发起流程
				if(this.prdMfrInfoService.checkMfrInfoFlowStatus(Long.valueOf(id))){
					throw new BaseException(BaseExceptionConstant.COMMON_0001, "该厂商存在准入流程，请流程结束后再发起审核流程.");
				}
				if(MfrInfoConstant.MFR_BASE_MOD_FLOW_DEF_KEY.equals(procDefKey)){
					//校验该厂商是否存在基础信息变更流程
					if(this.prdMfrInfoService.checkMfrBaseModFlowStatus(Long.valueOf(id))){
						throw new BaseException(BaseExceptionConstant.COMMON_0001, "该厂商存在基础信息变更流程，请变更流程结束后再发起审核流程.");
					}
					mfrInfoModDTO.setIsBscMdf(BaseConstant.IS_YESNO_YES);
					mfrInfoModDTO.setIsPayTypMdf(BaseConstant.IS_YESNO_NO);
					result.setInfo("厂商变更流程发起成功！");
				}else if(MfrInfoConstant.MFR_PAY_TYP_MOD_FLOW_DEF_KEY.equals(procDefKey)){
					//校验 判断该厂商是否在登陆人所属事业部 存在放款方式变更流程
					if(this.prdMfrInfoService.checkMfrPayTypModFlowStatus(Long.valueOf(id),CurrentThreadContext.getCurrentBuOrgCd())){
						throw new BaseException(BaseExceptionConstant.COMMON_0001, "该厂商存在放款方式变更流程，请变更流程结束后再发起审核流程.");
					}
					modelTyp = MfrInfoConstant.MFR_PAY_TYP_MOD_FLOW_BUS_TYP_CD;
					mfrInfoModDTO.setIsPayTypMdf(BaseConstant.IS_YESNO_YES);
					mfrInfoModDTO.setIsBscMdf(BaseConstant.IS_YESNO_NO);
					result.setInfo("放款方式变更流程发起成功！");
				}
				//是否附件信息变更
				boolean isFileApply = false ;
				JSONArray flieArry = null ;
				if(StringUtils.isNotEmpty(fileParams)){
					flieArry = JSONArray.fromObject(fileParams);
					if (!(flieArry.size() > 0)) {
						isFileApply = false;
					}else{
						isFileApply = true;
						mfrInfoModDTO.setIsFileMdf(BaseConstant.IS_YESNO_YES);
					}
				}
				mfrInfoModDTO.setIsRlPsnMdf(BaseConstant.IS_YESNO_NO);
				mfrInfoModDTO.setAudStsCd(FlowConstant.FLOW_CHECK_STATE_IN);
				mfrInfoModDTO.setCrtTm(new Date());
				mfrInfoModDTO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
				mfrInfoModDTO.setCrtUsrName(CurrentThreadContext.getCurrentUserName());
				mfrInfoModDTO.setIsDel(BaseConstant.IS_YESNO_NO);
				mfrInfoModDTO.setIsNew(BaseConstant.IS_YESNO_YES);
				mfrInfoModDTO.setIsValid(BaseConstant.IS_YESNO_YES);
				mfrInfoModDTO.setMfrId(Long.valueOf(id));
				mfrInfoModDTO.setTabNm(MfrInfoConstant.MFR_INFO_FLOW_S_H_MFR_TAB);

				Long modId = this.prdMfrInfoService.addMfrInfoMod(mfrInfoModDTO,mfrInfoDTO);
				if (StringUtils.isEmpty(id)) {
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
					BaseLogUtils.newWebLogger("修改厂商信息失败").setLogOperType(LogOperEnum.RESP)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.warn(LogExceptionEnum.COMMON_CODE_0002);
					return result;
				}
				//附件信息变更
				if(isFileApply){
					//COPY 旧附件信息
					List<SysUlFilesRecVO> oldUlFilesRecVOList = null;
					SysUlFilesRecQueryCondition filesRecQueryCondition = new SysUlFilesRecQueryCondition();
					filesRecQueryCondition.setSysCd(SplSystemConstant.SPL_SYS_CD);
					filesRecQueryCondition.setIsDel(0);
					filesRecQueryCondition.setPkId(String.valueOf(id));
					List<SysUlFilesRecVO> sysUlFilesRecVOs = this.sysUlFilesRecService.searchList(filesRecQueryCondition);
					BaseLogUtils.newWebLogger("修改供应商信息！就附件信息").setLogOperType(LogOperEnum.RESP)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setKeys("sysUlFilesRecVOs", JSON.toJSONString(sysUlFilesRecVOs))
							.info();
					if (CollectionUtils.isNotEmpty(sysUlFilesRecVOs)) {
						oldUlFilesRecVOList = new ArrayList<>(sysUlFilesRecVOs.size());
						SysUlFilesRecVO vo = null;
						for (SysUlFilesRecVO sysUlFilesRecVO : sysUlFilesRecVOs) {
							vo = sysUlFilesRecVO;
							vo.setId(null);
							vo.setPkId(String.valueOf(modId));
							oldUlFilesRecVOList.add(vo);
						}
					}
					BaseLogUtils.newWebLogger("修改供应商信息").setLogOperType(LogOperEnum.RESP)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setKeys("oldUlFilesRecVOList", JSON.toJSONString(oldUlFilesRecVOList))
							.info();
					if (CollectionUtils.isNotEmpty(oldUlFilesRecVOList)) {
						this.sysUlFilesRecService.addSysUlFilesResList(oldUlFilesRecVOList);
					}

					List<SysUlFilesRecVO> newUlFilesRecVOList = null ;
					try {
						newUlFilesRecVOList = this.getFileList(fileParams, modId);
						if (CollectionUtils.isNotEmpty(newUlFilesRecVOList)) {
							boolean success = this.sysUlFilesRecService.addSysUlFilesResList(newUlFilesRecVOList);
							if (!success) {
								BaseLogUtils.newWebLogger("新增厂商变更流程资料失败").setLogOperType(LogOperEnum.RESP)
										.setSysCd(CurrentThreadContext.getCurrentSysCd())
										.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
										.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
										.setWarning(false)
										.warn(LogExceptionEnum.COMMON_CODE_0002);
							} else {
							    this.prdMfrInfoService.modifyMfrInfoModDtlFileList(mfrInfoDTO.getId(),modId);
								BaseLogUtils.newWebLogger("新增厂商变更流程资料成功").setLogOperType(LogOperEnum.RESP)
										.setSysCd(CurrentThreadContext.getCurrentSysCd())
										.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
										.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
										.setWarning(false)
										.setKeys("newUlFilesRecVOList", JSON.toJSONString(newUlFilesRecVOList))
										.info();
							}
						}
					} catch (BaseException ex) {
						BaseLogUtils.newWebLogger("查询流程历史异常BaseException，业务异常").setLogOperType(LogOperEnum.REQ)
								.setSysCd(CurrentThreadContext.getCurrentSysCd())
								.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
								.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
								.setWarning(false)
								.setThrowable(ex)
								.warn(LogExceptionEnum.COMMON_CODE_0002);
					} catch (Exception ex) {
						BaseLogUtils.newWebLogger("新增厂商变更流程资料失败，系统异常").setLogOperType(LogOperEnum.REQ)
								.setSysCd(CurrentThreadContext.getCurrentSysCd())
								.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
								.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
								.setWarning(false)
								.setThrowable(ex)
								.error(LogExceptionEnum.COMMON_CODE_0099);
					}
				}

				FlowStartParamsDTO flowStartParamsDTO = new FlowStartParamsDTO();
				try {
					//流程定义Key和流程定义ID 如果是前端选择的则直接指定,如果不是则系统自动按照配置选择唯一一条记录,如果找不到会提示
					flowStartParamsDTO.setAudStsCd(FlowConstant.FLOW_CHECK_STATE_IN);

					flowStartParamsDTO.setWordsInTheTable(MfrInfoConstant.MFR_INFO_FLOW_S_H_MFR);
					//流程定义标识(必填)
					flowStartParamsDTO.setProcDefKey(procDefKey);
					//流程定义ID(必填)
					flowStartParamsDTO.setProcDefId(procDefId);
					//流程定义名称(自定义)
					flowStartParamsDTO.setProcNo(procNo);

					flowStartParamsDTO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
					//业务数据主键(必填)
					flowStartParamsDTO.setBusinessKey(String.valueOf(modId));
					flowStartParamsDTO.setOrgCd(CurrentThreadContext.getCurrentOrgCd());
					flowStartParamsDTO.setBuOrgCd(CurrentThreadContext.getCurrentBuOrgCd());
					flowStartParamsDTO.setSysCd(CurrentThreadContext.getCurrentSysCd());
					flowStartParamsDTO.setInitiator(String.valueOf(CurrentThreadContext.getCurrentUserId()));
					flowStartParamsDTO.setInitiatorNm(CurrentThreadContext.getCurrentUserName());
					flowStartParamsDTO.setProcPriority(FlowConstant.FLOW_PRIORITY_EMERGENCY);//优先级,可以在界面定义
					//业务类型(必填)-用于区分操作表标识
					flowStartParamsDTO.setBusinessType(MfrInfoConstant.MFR_INFO_MOD_FLOW_S_H_MFR_TAB);//确认用不用
					//模块类型(流程业务分类): 针对直接启动流程的业务使用
					flowStartParamsDTO.setModelTyp(modelTyp);//需要和流程配置中的模块类型匹配
					flowStartParamsDTO.setSearchDesc(CurrentThreadContext.getCurrentOrgDispNm()+"、厂商变更流程大字段参数未定!");
					DataResultDTO dataResultDTO = this.prdMfrInfoService.modifyMfrInfoFlowStart(flowStartParamsDTO);
					if(dataResultDTO != null){
						if(dataResultDTO.getCode() != null && !dataResultDTO.getCode().equals(BaseExceptionConstant.BASE_EXCEPTION_CODE_200)){
							this.prdMfrInfoService.removeMfrInfoMod(modId);
							result.setSuccess(BaseConstant.IS_YESNO_NO);
							result.setInfo(SysLogConstant.LOG_CMM_OPERATE_FAIL);
							BaseLogUtils.newWebLogger("厂商变更流程发起失败").setLogOperType(LogOperEnum.RESP)
									.setSysCd(CurrentThreadContext.getCurrentSysCd())
									.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
									.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
									.setWarning(false)
									.warn(LogExceptionEnum.COMMON_CODE_0002);
							return result;
						}
					}
				} catch (BaseException e) {
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo(e.getMessage());
					BaseLogUtils.newWebLogger("厂商变更流程发起失败，业务异常").setLogOperType(LogOperEnum.REQ)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setThrowable(e)
							.warn(LogExceptionEnum.COMMON_CODE_0002);
					e.getStackTrace();
				} catch (Exception e) {
					result.setSuccess(BaseConstant.IS_YESNO_NO);
					result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
					BaseLogUtils.newWebLogger("厂商变更流程发起失败，系统异常").setLogOperType(LogOperEnum.REQ)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setThrowable(e)
							.error(LogExceptionEnum.COMMON_CODE_0099);
					e.getStackTrace();
				}
			}else{
				result.setInfo("厂商信息修改成功！");
			}
			this.prdMfrInfoService.modifyMfrBscInfoFlow(mfrInfoDTO);
			BaseLogUtils.newWebLogger("修改厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("result", JSON.toJSONString(result))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("修改厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("修改厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

    /**
     * 获取厂商变更流程资料信息
     *
     * @param fileParams
     * @return
     * @throws BaseException
     */
    private List<SysUlFilesRecVO> getFileList(String fileParams, Long modId) throws BaseException {
        List<SysUlFilesRecVO> sysUlFilesRecVOList = new ArrayList<SysUlFilesRecVO>();
        //解析附件上传信息
        if (StringUtils.isNotEmpty(fileParams)) {
            List<Map<String, String>> fileParamsList = new ArrayList<Map<String, String>>();
            JSONArray arry = JSONArray.fromObject(fileParams);
            if (!(arry.size() > 0)) {
                return null;
            }
            for (int i = 0; i < arry.size(); i++) {
                net.sf.json.JSONObject jsonObject = arry.getJSONObject(i);
                Iterator<?> it = jsonObject.keys();
                HashMap<String, String> hMap = new HashMap<String, String>();
                while (it.hasNext()) {
                    String key = String.valueOf(it.next());
                    String value = (String) jsonObject.get(key);
                    hMap.put(key, value);
                }
                fileParamsList.add(hMap);
            }
            for (Map<String, String> map : fileParamsList) {
                SysUlFilesRecVO sysUlFilesRecVO = new SysUlFilesRecVO();
                sysUlFilesRecVO.setFileNm(map.get("fileNm"));
                sysUlFilesRecVO.setFilePath(map.get("filePath"));
                sysUlFilesRecVO.setAbsLocPath(PropertiesCacheUtils.getProperty(UploadConstant.UPLOAD_ROOT_PATH) + map.get("filePath"));
                sysUlFilesRecVO.setCrtTm(new Date());
                sysUlFilesRecVO.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
                sysUlFilesRecVO.setPkId(modId + "");
                sysUlFilesRecVO.setSysCd(map.get("sysCd"));
                sysUlFilesRecVO.setOrgCd(map.get("orgCd"));
                sysUlFilesRecVO.setCfgCd(map.get("cfgCd"));
                sysUlFilesRecVO.setCfgDtlCd(map.get("cfgDtlCd"));
                //默认验证状态:未验证
                sysUlFilesRecVO.setAudStsCd(PropertiesCacheUtils.getProperty(fl.constant.facade.framework.constant.DictionaryConstant.CODE_GRP_VALID_STATUS_CD_A));
                sysUlFilesRecVO.setTabNm(map.get("tabNm"));
                sysUlFilesRecVO.setIsDel(BaseConstant.IS_YESNO_NO);
                sysUlFilesRecVOList.add(sysUlFilesRecVO);
            }
        } else {
            throw new BaseException(BaseExceptionConstant.COMMON_0001, "保存厂商变更流程资料信息,没有要保存的资料.");
        }
        return sysUlFilesRecVOList;
    }

	/**
	 * 获取流程中的厂商详情
	 *
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getMfrInfoFlowById.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object getMfrInfoFlowById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
        String modId = request.getParameter("modId");
        String currentOrgCd = request.getParameter("currentOrgCd");
        String isFlow = request.getParameter("isFlow");

		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if (StringUtils.isEmpty(id) || StringUtils.isEmpty(modId)) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("获取厂商数据,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
			return result;
		}

		if(StringUtils.isNotEmpty(isFlow) && BaseConstant.IS_YESNO_YES_STR.equals(isFlow)){
			SysFlowSHQueryCondition sysFlowSHQueryCondition = new SysFlowSHQueryCondition();
			sysFlowSHQueryCondition.setWordsInTheTable(MfrInfoConstant.MFR_INFO_FLOW_S_H_MFR);
			sysFlowSHQueryCondition.setStatus(BaseConstant.IS_YESNO_YES);
			sysFlowSHQueryCondition.setDataId(Long.valueOf(id));
			sysFlowSHQueryCondition.setSysCd(CurrentThreadContext.getCurrentSysCd());
			List<SysFlowSHDTO> sysFlowSHDTOS = this.flowApiService.searchFlowSHDTOList(sysFlowSHQueryCondition);
			if(CollectionUtils.isNotEmpty(sysFlowSHDTOS)){
				currentOrgCd = sysFlowSHDTOS.get(0).getOrgCd();
			}
		}

		try {
			MfrInfoVO vo = this.prdMfrInfoService.selectMfrFlowById(Long.valueOf(id),Long.valueOf(modId),currentOrgCd);
			if (null == vo) {
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.newWebLogger("获取厂商数据不存在").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
			}

			result.setData(vo);
			BaseLogUtils.newWebLogger("获取厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("result", JSON.toJSONString(result))
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("获取厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("获取厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 呈报人再次修改
	 *
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/modifyMfrAgain.do", method = {RequestMethod.POST})
	@ResponseBody
	public Object modifyMfrAgain(HttpServletRequest request, HttpServletResponse response) throws BaseException {
        String id = request.getParameter("id");
        String modId = request.getParameter("modId");
        String fileParams = request.getParameter("fileParams");
        String isFlow = request.getParameter("isFlow");
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_UPDATE_SUCC);
        MfrInfoDTO entity = new MfrInfoDTO();
        if (StringUtils.isEmpty(id) || StringUtils.isEmpty(modId)) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("修改厂商信息,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
            return result;
        }
        try {
			if(StringUtils.isNotEmpty(fileParams)){
				JSONArray arry = JSONArray.fromObject(fileParams);
				if (arry.size() > 0) {
					//COPY 旧附件信息
					SysUlFilesRecQueryCondition filesRecQueryCondition = new SysUlFilesRecQueryCondition();
					filesRecQueryCondition.setSysCd(SplSystemConstant.SPL_SYS_CD);
					filesRecQueryCondition.setIsDel(BaseConstant.IS_YESNO_NO);
					filesRecQueryCondition.setPkId(modId);
					filesRecQueryCondition.setTabNm(MfrInfoConstant.MFR_INFO_MOD_FLOW_S_H_MFR_TAB);
					List<SysUlFilesRecVO> sysUlFilesRecVOs = this.sysUlFilesRecService.searchList(filesRecQueryCondition);
					BaseLogUtils.newWebLogger("修改厂商附件信息").setLogOperType(LogOperEnum.RESP)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setKeys("sysUlFilesRecVOs", JSON.toJSONString(sysUlFilesRecVOs))
							.info();
					List<Long> ids = null ;
					if (CollectionUtils.isNotEmpty(sysUlFilesRecVOs)) {
						ids = new ArrayList<>();
						for (SysUlFilesRecVO sysUlFilesRecVO : sysUlFilesRecVOs) {
							ids.add(sysUlFilesRecVO.getId());
						}
					}
					if (null != ids) {
						this.sysUlFilesRecService.removeByIds(ids);
					}
				}
				List<SysUlFilesRecVO> newUlFilesRecVOList = new ArrayList<SysUlFilesRecVO>();
				try {
					newUlFilesRecVOList = this.getFileList(fileParams, Long.valueOf(modId));
					if (CollectionUtils.isNotEmpty(newUlFilesRecVOList)) {
						boolean success = this.sysUlFilesRecService.addSysUlFilesResList(newUlFilesRecVOList);
						if (!success) {
							BaseLogUtils.newWebLogger("新增厂商变更流程资料失败").setLogOperType(LogOperEnum.RESP)
									.setSysCd(CurrentThreadContext.getCurrentSysCd())
									.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
									.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
									.setWarning(false)
									.warn(LogExceptionEnum.COMMON_CODE_0002);
						} else {
                            this.prdMfrInfoService.modifyMfrInfoModDtlFileList(Long.valueOf(id),Long.valueOf(modId));
							BaseLogUtils.newWebLogger("新增厂商变更流程资料成功").setLogOperType(LogOperEnum.RESP)
									.setSysCd(CurrentThreadContext.getCurrentSysCd())
									.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
									.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
									.setWarning(false)
									.setKeys("newUlFilesRecVOList", JSON.toJSONString(newUlFilesRecVOList))
									.info();
						}
					}
				} catch (BaseException ex) {
					BaseLogUtils.newWebLogger("新增厂商变更流程资料失败，业务异常").setLogOperType(LogOperEnum.REQ)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setThrowable(ex)
							.warn(LogExceptionEnum.COMMON_CODE_0002);
				} catch (Exception ex) {
					BaseLogUtils.newWebLogger("新增厂商变更流程资料失败，系统异常").setLogOperType(LogOperEnum.REQ)
							.setSysCd(CurrentThreadContext.getCurrentSysCd())
							.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
							.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
							.setWarning(false)
							.setThrowable(ex)
							.error(LogExceptionEnum.COMMON_CODE_0099);
				}
			}

            entity = MfrInfoVOTransform.toDTO(this.getRequestParamForPrdMfrModify(request));
            entity.setId(Long.valueOf(id));
            entity.setBuOrgCd(CurrentThreadContext.getCurrentBuOrgCd());
            boolean success = this.prdMfrInfoService.modifyBscAgain(entity, modId);
            if (!success) {
                result.setSuccess(BaseConstant.IS_YESNO_NO);
                result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
				BaseLogUtils.newWebLogger("修改厂商数据失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0002);
            }
			BaseLogUtils.newWebLogger("修改厂商数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setKeys("entity", JSON.toJSONString(entity))
					.info();
        } catch (BaseException ex) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(ex.getMessage());
			BaseLogUtils.newWebLogger("修改厂商数据失败，业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0002);
        } catch (Exception ex) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("修改厂商数据失败，系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_PROD_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
        }
        return result;
    }

}